import asyncio


async def func():
    print(1)
    await asyncio.sleep(2)
    print(2)
    return 'sxj'


async def main():
    print('main开始')
    tasks = [
        asyncio.create_task(func()),
        asyncio.create_task(func())
    ]
    print('main结束')
    done, peding = await asyncio.wait(tasks)
    print(done)

if __name__ == '__main__':
    asyncio.run(main())